From: Jonathan Dieter Date: Mon, 21 May 2018 18:34:53 +0000 (+0300) Subject: Move buffer size into util_common.h X-Git-Tag: archive/raspbian/1.1.9+ds1-1+rpi1~1^2~274 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=2b5f6b3a02ef578572d1173b62e4f0d00fe2659e;p=zchunk.git Move buffer size into util_common.h Signed-off-by: Jonathan Dieter --- diff --git a/src/unzck.c b/src/unzck.c index d73ab00..9f30e3b 100644 --- a/src/unzck.c +++ b/src/unzck.c @@ -37,8 +37,6 @@ #include "util_common.h" -#define BLK_SIZE 32768 - static char doc[] = "unzck - Decompress a zchunk file"; static char args_doc[] = ""; @@ -130,10 +128,10 @@ int main (int argc, char *argv[]) { if(zck == NULL) goto error1; - char *data = malloc(BLK_SIZE); + char *data = malloc(BUF_SIZE); size_t total = 0; while(True) { - ssize_t read = zck_read(zck, data, BLK_SIZE); + ssize_t read = zck_read(zck, data, BUF_SIZE); if(read < 0) goto error2; if(read == 0) diff --git a/src/util_common.h b/src/util_common.h index dd0103a..2f74cfc 100644 --- a/src/util_common.h +++ b/src/util_common.h @@ -4,6 +4,10 @@ #define ZCK_NAME "zchunk" #define ZCK_COPYRIGHT_YEAR "2018" +#ifndef BUF_SIZE +#define BUF_SIZE 32768 +#endif + void version(); #endif